﻿var lovid = "ADM.EMPLOYEELIST";

AddAdmin = function(){
    var lovh = $id("lovh_" + lovid);
    var hf = $id("hfAdd");
    var btn = $id("btnAdd");
    hf.value = "add";
    dgMain_c.PerformCallback( hf.value + DELIMITER + lovh.value );
    
    btn.style.display = "none";
}

DeleteAdmin = function(id){
    if(confirm("Delete admin?"))
    {
        var hf = $id("hfAdd");
        hf.value = "del";
        dgMain_c.PerformCallback( hf.value + DELIMITER + id );
    }
}

dgMain_c_CallbackComplete = function(e){
    var hf = $id("hfAdd");
    if( hf.value == "add" )
    {
        var btn = $id("btnAdd");
        var lov = $id("lov_" + lovid);
        var lovh = $id("lovh_" + lovid);
        
        lov.value = lovh.value = "";    
        btn.style.display = "";
    }
}

toggle = function (fsid)
{
    var div = $id("div_" + fsid);
    var lnk = $id("lnk_" + fsid);
    
    var display = "";
    
    if( div.style.display != "none" )
    {
        display = "none";
    }
    
    div.style.display = display;
    
    if( lnk != null )
    {
        lnk.style.display = display;
    }
}

StartLoadingAnimation = function(div){
    div.innerHTML = "<img src='" + LOADING.src + "' alt='' />";    
}

EndLoadingAnimation = function(div){
    div.innerHTML = "";    
}